package com.rc.saas.tenant.vo.acct;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.rc.saas.tenant.model.acct.AcctBillOrder;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author frog
 * @date 2021/1/13
 */
@ExcelIgnoreUnannotated
public class AcctBillOrderResultVo extends AcctBillOrder {
    @ExcelProperty(value = "分销商名称",index = 2)
    private String operatorName;
    private String loginName;
    @ExcelProperty(value = "站点", index = 1)
    private String stationName;
    private String elecAcctRule;
    private String serviceAcctRule;
    /**结算电费*/
    @ExcelProperty(value = "结算电费",index = 21)
    private BigDecimal elecAcctAmount;
    /**结算服务费*/
    @ExcelProperty(value = "结算服务费",index = 22)
    private BigDecimal serviceAcctAmount;
    /**结算总金额*/
    @ExcelProperty(value = "结算总金额",index = 23)
    private BigDecimal totalAcctAmount;
    @ExcelProperty(value = "规则说明", index = 14)
    private String acctRuleRemark;
    @ExcelProperty(value = "账单日", index = 10)
    private String acctDayString;

    @ExcelProperty(value = "结算规则", index = 13)
    private String settlementRule;

    @ExcelProperty(value = "状态", index = 25)
    private String statusString;

//    @ExcelProperty(value = "异常订单电费差值",index = 25)
//    private BigDecimal diffElecMoney;
//
//    @ExcelProperty(value = "异常订单服务费差值",index = 26)
//    private BigDecimal diffServiceMoney;

    private BigDecimal consultOrderAmount;

    public BigDecimal getConsultOrderAmount() {
        return consultOrderAmount;
    }

    public void setConsultOrderAmount(BigDecimal consultOrderAmount) {
        this.consultOrderAmount = consultOrderAmount;
    }

//    public BigDecimal getDiffElecMoney() {
//        return diffElecMoney;
//    }
//
//    public void setDiffElecMoney(BigDecimal diffElecMoney) {
//        this.diffElecMoney = diffElecMoney;
//    }
//
//    public BigDecimal getDiffServiceMoney() {
//        return diffServiceMoney;
//    }
//
//    public void setDiffServiceMoney(BigDecimal diffServiceMoney) {
//        this.diffServiceMoney = diffServiceMoney;
//    }

    public String getAcctDayString() {
        if (this.getAcctDay() != null) {
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(this.getAcctDay());
            calendar.add(Calendar.DAY_OF_MONTH, -1);
            SimpleDateFormat format = new SimpleDateFormat("dd");
            String date = format.format(calendar.getTime());
            return date;
        } else {
            return "";
        }
    }

    public String getStatusString() {
        if ("0".equals(this.getStatus())) {
            return "待审核";
        } else if ("1".equals(this.getStatus())) {
            return "待确认账单";
        } else if ("2".equals(this.getStatus())) {
            return "复核中";
        } else if ("3".equals(this.getStatus())) {
            return "结算完成";
        } else if ("4".equals(this.getStatus())) {
            return "待推送";
        }
        return "";
    }

    public BigDecimal getElecAcctAmount() {
        return elecAcctAmount;
    }

    public void setElecAcctAmount(BigDecimal elecAcctAmount) {
        this.elecAcctAmount = elecAcctAmount;
    }

    public BigDecimal getServiceAcctAmount() {
        return serviceAcctAmount;
    }

    public void setServiceAcctAmount(BigDecimal serviceAcctAmount) {
        this.serviceAcctAmount = serviceAcctAmount;
    }

    public void setStatusString(String statusString) {
        this.statusString = statusString;
    }

    public String getSettlementRule() {
        if(this.getElecAcctRule()!=null&&this.getElecAcctRule()!=""&&this.getServiceAcctRule()!=null&&this.getServiceAcctRule()!=""){
            return this.getElecAcctRule() + ";" + this.getServiceAcctRule();
        }
        return "";

    }

    public void setSettlementRule(String settlementRule) {
        this.settlementRule = settlementRule;
    }

    public void setAcctDayString(String acctDayString) {
        this.acctDayString = acctDayString;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getElecAcctRule() {
        return elecAcctRule;
    }

    public void setElecAcctRule(String elecAcctRule) {
        this.elecAcctRule = elecAcctRule;
    }

    public String getServiceAcctRule() {
        return serviceAcctRule;
    }

    public void setServiceAcctRule(String serviceAcctRule) {
        this.serviceAcctRule = serviceAcctRule;
    }

    public String getAcctRuleRemark() {
        return acctRuleRemark;
    }

    public void setAcctRuleRemark(String acctRuleRemark) {
        this.acctRuleRemark = acctRuleRemark;
    }

    public BigDecimal getTotalAcctAmount() {
        return totalAcctAmount;
    }

    public void setTotalAcctAmount(BigDecimal totalAcctAmount) {
        this.totalAcctAmount = totalAcctAmount;
    }
}
